function OrderDetails(params){ 
	 
}

OrderDetails.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new OrderDetails.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new OrderDetails.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new OrderDetails.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.id=function(id){if(this.proxy)return this.getProxy().id(id);  this.put("id", id);return this;};
	/** and id is null */
	this.idNull=function(){if(this.proxy)return this.getProxy().idNull();if(this.get("idNot")==null)this.put("idNot", "");this.put("id", null);return this;};
	/** not .... */
	this.idNot=function(){if(this.proxy)return this.getProxy().idNot();this.put("idNot", "not");return this;};
	this.idNotNull=function(){if(this.proxy)return this.getProxy().idNotNull();this.put("idNot", "not");this.put("id", null);return this;};
	this.idNot=function(id){if(this.proxy)return this.getProxy().idNot(id);this.put("idNot", "not");this.put("id", id);return this;};
	/** and id <= ? */
	this.idMin=function(min){if(this.proxy)return this.getProxy().idMin(min);this.put("idMin", min);return this;};
	/** and id >= ? */
	this.idMax=function(max){if(this.proxy)return this.getProxy().idMax(max);this.put("idMax", max);return this;};
	this.idIn=function(ids){
		if(this.proxy)return this.getProxy().idIn(ids);  this.put("idIn", ids);return this;
	};	
	
	/** 商品名称 [非空]       **/
	this.name=function(name){if(this.proxy)return this.getProxy().name(name);  this.put("name", name);return this;};
	/** and name is null */
	this.nameNull=function(){if(this.proxy)return this.getProxy().nameNull();if(this.get("nameNot")==null)this.put("nameNot", "");this.put("name", null);return this;};
	/** not .... */
	this.nameNot=function(){if(this.proxy)return this.getProxy().nameNot();this.put("nameNot", "not");return this;};
	this.nameNotNull=function(){if(this.proxy)return this.getProxy().nameNotNull();this.put("nameNot", "not");this.put("name", null);return this;};
	this.nameNot=function(name){if(this.proxy)return this.getProxy().nameNot(name);this.put("nameNot", "not");this.put("name", name);return this;};
	
	/** 所属订单 [非空] [DirectOrder]      **/
	this.orders=function(orders){if(this.proxy)return this.getProxy().orders(orders);  this.put("orders", orders);return this;};
	/** and orders is null */
	this.ordersNull=function(){if(this.proxy)return this.getProxy().ordersNull();if(this.get("ordersNot")==null)this.put("ordersNot", "");this.put("orders", null);return this;};
	/** not .... */
	this.ordersNot=function(){if(this.proxy)return this.getProxy().ordersNot();this.put("ordersNot", "not");return this;};
	this.ordersNotNull=function(){if(this.proxy)return this.getProxy().ordersNotNull();this.put("ordersNot", "not");this.put("orders", null);return this;};
	this.ordersNot=function(orders){if(this.proxy)return this.getProxy().ordersNot(orders);this.put("ordersNot", "not");this.put("orders", orders);return this;};
	this.ordersIn=function(ids){
		if(this.proxy)return this.getProxy().ordersIn(ids);  this.put("ordersIn", ids);return this;
	};	
	
	/** 商品编号 [非空] [Commodity]      **/
	this.goodsNumber=function(goodsNumber){if(this.proxy)return this.getProxy().goodsNumber(goodsNumber);  this.put("goodsNumber", goodsNumber);return this;};
	/** and goods_number is null */
	this.goodsNumberNull=function(){if(this.proxy)return this.getProxy().goodsNumberNull();if(this.get("goodsNumberNot")==null)this.put("goodsNumberNot", "");this.put("goodsNumber", null);return this;};
	/** not .... */
	this.goodsNumberNot=function(){if(this.proxy)return this.getProxy().goodsNumberNot();this.put("goodsNumberNot", "not");return this;};
	this.goodsNumberNotNull=function(){if(this.proxy)return this.getProxy().goodsNumberNotNull();this.put("goodsNumberNot", "not");this.put("goodsNumber", null);return this;};
	this.goodsNumberNot=function(goodsNumber){if(this.proxy)return this.getProxy().goodsNumberNot(goodsNumber);this.put("goodsNumberNot", "not");this.put("goodsNumber", goodsNumber);return this;};
	this.goodsNumberIn=function(ids){
		if(this.proxy)return this.getProxy().goodsNumberIn(ids);  this.put("goodsNumberIn", ids);return this;
	};	
	
	/** 商品图        **/
	this.img=function(img){if(this.proxy)return this.getProxy().img(img);  this.put("img", img);return this;};
	/** and img is null */
	this.imgNull=function(){if(this.proxy)return this.getProxy().imgNull();if(this.get("imgNot")==null)this.put("imgNot", "");this.put("img", null);return this;};
	/** not .... */
	this.imgNot=function(){if(this.proxy)return this.getProxy().imgNot();this.put("imgNot", "not");return this;};
	this.imgNotNull=function(){if(this.proxy)return this.getProxy().imgNotNull();this.put("imgNot", "not");this.put("img", null);return this;};
	this.imgNot=function(img){if(this.proxy)return this.getProxy().imgNot(img);this.put("imgNot", "not");this.put("img", img);return this;};
	
	/** 商品价格 [非空]       **/
	this.price=function(price){if(this.proxy)return this.getProxy().price(price);  this.put("price", price);return this;};
	/** and price is null */
	this.priceNull=function(){if(this.proxy)return this.getProxy().priceNull();if(this.get("priceNot")==null)this.put("priceNot", "");this.put("price", null);return this;};
	/** not .... */
	this.priceNot=function(){if(this.proxy)return this.getProxy().priceNot();this.put("priceNot", "not");return this;};
	this.priceNotNull=function(){if(this.proxy)return this.getProxy().priceNotNull();this.put("priceNot", "not");this.put("price", null);return this;};
	this.priceNot=function(price){if(this.proxy)return this.getProxy().priceNot(price);this.put("priceNot", "not");this.put("price", price);return this;};
	/** and price <= ? */
	this.priceMin=function(min){if(this.proxy)return this.getProxy().priceMin(min);this.put("priceMin", min);return this;};
	/** and price >= ? */
	this.priceMax=function(max){if(this.proxy)return this.getProxy().priceMax(max);this.put("priceMax", max);return this;};
	
	/** 数量 [非空]       **/
	this.number=function(number){if(this.proxy)return this.getProxy().number(number);  this.put("number", number);return this;};
	/** and number is null */
	this.numberNull=function(){if(this.proxy)return this.getProxy().numberNull();if(this.get("numberNot")==null)this.put("numberNot", "");this.put("number", null);return this;};
	/** not .... */
	this.numberNot=function(){if(this.proxy)return this.getProxy().numberNot();this.put("numberNot", "not");return this;};
	this.numberNotNull=function(){if(this.proxy)return this.getProxy().numberNotNull();this.put("numberNot", "not");this.put("number", null);return this;};
	this.numberNot=function(number){if(this.proxy)return this.getProxy().numberNot(number);this.put("numberNot", "not");this.put("number", number);return this;};
	/** and number <= ? */
	this.numberMin=function(min){if(this.proxy)return this.getProxy().numberMin(min);this.put("numberMin", min);return this;};
	/** and number >= ? */
	this.numberMax=function(max){if(this.proxy)return this.getProxy().numberMax(max);this.put("numberMax", max);return this;};
	this.numberIn=function(ids){
		if(this.proxy)return this.getProxy().numberIn(ids);  this.put("numberIn", ids);return this;
	};	
	
	/** 所选属性        **/
	this.attributes=function(attributes){if(this.proxy)return this.getProxy().attributes(attributes);  this.put("attributes", attributes);return this;};
	/** and attributes is null */
	this.attributesNull=function(){if(this.proxy)return this.getProxy().attributesNull();if(this.get("attributesNot")==null)this.put("attributesNot", "");this.put("attributes", null);return this;};
	/** not .... */
	this.attributesNot=function(){if(this.proxy)return this.getProxy().attributesNot();this.put("attributesNot", "not");return this;};
	this.attributesNotNull=function(){if(this.proxy)return this.getProxy().attributesNotNull();this.put("attributesNot", "not");this.put("attributes", null);return this;};
	this.attributesNot=function(attributes){if(this.proxy)return this.getProxy().attributesNot(attributes);this.put("attributesNot", "not");this.put("attributes", attributes);return this;};
	
	/** 配送商可获收益        **/
	this.distributorIncome=function(distributorIncome){if(this.proxy)return this.getProxy().distributorIncome(distributorIncome);  this.put("distributorIncome", distributorIncome);return this;};
	/** and distributor_income is null */
	this.distributorIncomeNull=function(){if(this.proxy)return this.getProxy().distributorIncomeNull();if(this.get("distributorIncomeNot")==null)this.put("distributorIncomeNot", "");this.put("distributorIncome", null);return this;};
	/** not .... */
	this.distributorIncomeNot=function(){if(this.proxy)return this.getProxy().distributorIncomeNot();this.put("distributorIncomeNot", "not");return this;};
	this.distributorIncomeNotNull=function(){if(this.proxy)return this.getProxy().distributorIncomeNotNull();this.put("distributorIncomeNot", "not");this.put("distributorIncome", null);return this;};
	this.distributorIncomeNot=function(distributorIncome){if(this.proxy)return this.getProxy().distributorIncomeNot(distributorIncome);this.put("distributorIncomeNot", "not");this.put("distributorIncome", distributorIncome);return this;};
	/** and distributor_income <= ? */
	this.distributorIncomeMin=function(min){if(this.proxy)return this.getProxy().distributorIncomeMin(min);this.put("distributorIncomeMin", min);return this;};
	/** and distributor_income >= ? */
	this.distributorIncomeMax=function(max){if(this.proxy)return this.getProxy().distributorIncomeMax(max);this.put("distributorIncomeMax", max);return this;};
	
	/** 修改时间 [非空]       **/
	this.updateTime=function(updateTime){if(this.proxy)return this.getProxy().updateTime(updateTime);  this.put("updateTime", updateTime);return this;};
	/** and update_time is null */
	this.updateTimeNull=function(){if(this.proxy)return this.getProxy().updateTimeNull();if(this.get("updateTimeNot")==null)this.put("updateTimeNot", "");this.put("updateTime", null);return this;};
	/** not .... */
	this.updateTimeNot=function(){if(this.proxy)return this.getProxy().updateTimeNot();this.put("updateTimeNot", "not");return this;};
	this.updateTimeNotNull=function(){if(this.proxy)return this.getProxy().updateTimeNotNull();this.put("updateTimeNot", "not");this.put("updateTime", null);return this;};
	this.updateTimeNot=function(updateTime){if(this.proxy)return this.getProxy().updateTimeNot(updateTime);this.put("updateTimeNot", "not");this.put("updateTime", updateTime);return this;};
	/** and update_time >= ? */
	this.updateTimeStart=function(start){if(this.proxy)return this.getProxy().updateTimeStart(start);this.put("updateTimeStart", start);return this;};			
	/** and update_time <= ? */
	this.updateTimeEnd=function(end){if(this.proxy)return this.getProxy().updateTimeEnd(end);this.put("updateTimeEnd", end);return this;};
	
	/** 添加时间 [非空]       **/
	this.addTime=function(addTime){if(this.proxy)return this.getProxy().addTime(addTime);  this.put("addTime", addTime);return this;};
	/** and add_time is null */
	this.addTimeNull=function(){if(this.proxy)return this.getProxy().addTimeNull();if(this.get("addTimeNot")==null)this.put("addTimeNot", "");this.put("addTime", null);return this;};
	/** not .... */
	this.addTimeNot=function(){if(this.proxy)return this.getProxy().addTimeNot();this.put("addTimeNot", "not");return this;};
	this.addTimeNotNull=function(){if(this.proxy)return this.getProxy().addTimeNotNull();this.put("addTimeNot", "not");this.put("addTime", null);return this;};
	this.addTimeNot=function(addTime){if(this.proxy)return this.getProxy().addTimeNot(addTime);this.put("addTimeNot", "not");this.put("addTime", addTime);return this;};
	/** and add_time >= ? */
	this.addTimeStart=function(start){if(this.proxy)return this.getProxy().addTimeStart(start);this.put("addTimeStart", start);return this;};			
	/** and add_time <= ? */
	this.addTimeEnd=function(end){if(this.proxy)return this.getProxy().addTimeEnd(end);this.put("addTimeEnd", end);return this;};
	
	/** 状态 [非空]   1:正常 0:无效     **/
	this.status=function(status){if(this.proxy)return this.getProxy().status(status);  this.put("status", status);return this;};
	/** and status is null */
	this.statusNull=function(){if(this.proxy)return this.getProxy().statusNull();if(this.get("statusNot")==null)this.put("statusNot", "");this.put("status", null);return this;};
	/** not .... */
	this.statusNot=function(){if(this.proxy)return this.getProxy().statusNot();this.put("statusNot", "not");return this;};
	this.statusNotNull=function(){if(this.proxy)return this.getProxy().statusNotNull();this.put("statusNot", "not");this.put("status", null);return this;};
	this.statusNot=function(status){if(this.proxy)return this.getProxy().statusNot(status);this.put("statusNot", "not");this.put("status", status);return this;};
	this.statusIn=function(ids){
		if(this.proxy)return this.getProxy().statusIn(ids);  this.put("statusIn", ids);return this;
	};	
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有订单明细 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/goods/orderdetails.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取订单明细分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/goods/orderdetails.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取订单明细 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/goods/orderdetails.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

OrderDetails.get = function(id){
	var protocol = ux.ajax("/admin/goods/orderdetails.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.orderDetails;
	return null;
}

OrderDetails.where = new OrderDetails.Where(0,true);